package com.cmcc.pcap.jpcap.jpcap.packet;

import jpcap.packet.IPPacket;
import jpcap.packet.Packet;
import jpcap.packet.TCPPacket;

public class VLanIPPacket extends Packet {
	
	public short vlan_priority;//可暂不处理
	public short vlan_cfi;//可暂不处理
	public short vlan_id;//可暂不处理
    public short vlan_type;
    
    public IPPacket ipPacket;
    
    
    
    public static IPPacket reCodeIpPacket(Packet packet){
    	
    	/**
    	 * 先解析出vlan_type
    	 * 判断vlan_type，先只处理IPv4,如果IPv6返回null
    	 * 判断IPv4的Protocol，先只处理TCP,如果UDP或SCTP等，返回null
    	 * 生成TCPPacket实例，参数赋值
    	 * 把其父类(IPPacket)的相关参数都赋值
    	 */
    	TCPPacket tcpPacket = null;
    	//TCPPacket tcpPacket = new TCPPacket(caplen, caplen, sec, sec, false, false, false, false, false, false, false, false, caplen, caplen);
    	//tcpPacket.setIPv4Value(ver, pri, d, t, r, rsv_tos, rf, df, mf, offset, len, ident, ttl, proto, src, dst);
    	
    	return tcpPacket;
    }
    
    
    
    
}
